/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hieu.sms.model;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 
 * @author do_th
 */
@Entity
@Table(name = "student_suspended")
@NamedQueries({
		@NamedQuery(name = "StudentSuspended.findAll", query = "SELECT s FROM StudentSuspended s"),
		@NamedQuery(name = "StudentSuspended.findById", query = "SELECT s FROM StudentSuspended s WHERE s.id = :id"),
		@NamedQuery(name = "StudentSuspended.findByStudentId", query = "SELECT s FROM StudentSuspended s WHERE s.studentId = :studentId"),
		@NamedQuery(name = "StudentSuspended.findByTypeSuspended", query = "SELECT s FROM StudentSuspended s WHERE s.typeSuspended = :typeSuspended"),
		@NamedQuery(name = "StudentSuspended.findBySuspendDate", query = "SELECT s FROM StudentSuspended s WHERE s.suspendDate = :suspendDate"),
		@NamedQuery(name = "StudentSuspended.findByReason", query = "SELECT s FROM StudentSuspended s WHERE s.reason = :reason"),
		@NamedQuery(name = "StudentSuspended.findByComment", query = "SELECT s FROM StudentSuspended s WHERE s.comment = :comment") })
public class StudentSuspended extends AbstractPersistentEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id", updatable = false)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "StudentSuspendedSequence")
	@SequenceGenerator(name = "StudentSuspendedSequence", sequenceName = "seq_student_suspended", allocationSize = 1)
	private Long id;
	@Basic(optional = false)
	@Column(name = "student_id")
	private String studentId;
	@Basic(optional = false)
	@Column(name = "type_suspended")
	private String typeSuspended;
	@Basic(optional = false)
	@Column(name = "suspend_date")
	@Temporal(TemporalType.DATE)
	private Date suspendDate;
	@Basic(optional = false)
	@Column(name = "reason")
	private String reason;
	@Column(name = "comment")
	private String comment;

	public StudentSuspended() {
	}

	public StudentSuspended(Long id) {
		this.id = id;
	}

	public StudentSuspended(Long id, String studentId, String typeSuspended,
			Date suspendDate, String reason) {
		this.id = id;
		this.studentId = studentId;
		this.typeSuspended = typeSuspended;
		this.suspendDate = suspendDate;
		this.reason = reason;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getStudentId() {
		return studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

	public String getTypeSuspended() {
		return typeSuspended;
	}

	public void setTypeSuspended(String typeSuspended) {
		this.typeSuspended = typeSuspended;
	}

	public Date getSuspendDate() {
		return suspendDate;
	}

	public void setSuspendDate(Date suspendDate) {
		this.suspendDate = suspendDate;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof StudentSuspended)) {
			return false;
		}
		StudentSuspended other = (StudentSuspended) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "com.hieu.sms.model.StudentSuspended[ id=" + id + " ]";
	}

}
